<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{$description}">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href='__PUBLIC__/image/logo.png' type="image/png">

    <title>{$title}</title>
    {css href="__PUBLIC__/admin/css/style.css,__PUBLIC__/admin/css/style-responsive.css,__PUBLIC__/css/common.css" /}
    {js href="__PUBLIC__/admin/js/html5shiv.js,__PUBLIC__/admin/js/respond.min.js" /}
</head>

<body class="login-body">

<div class="container">

    <form class="form-signin" method="post" id="loginform">
        <div class="form-signin-heading text-center">
            <h1 class="sign-title">Login</h1>
            <img src="__PUBLIC__/admin/images/login-logo.png" alt="" />
        </div>
        <div class="login-wrap">
            <input type="tel" class="form-control" name="tel" placeholder="用户名" >
            <input type="password" class="form-control" name="password" placeholder="密码">
            <div class="row"><div class="col-xs-6"><input type="text" class="form-control" placeholder="验证码" name="verifycode"></div><div class="col-xs-6"> <img src="{:WebUrl('index/verifycode','')}"   alt="点击切换" onclick="this.src='{:WebUrl('index/verifycode','')}?d='+Math.random();"></div></div>
            <button class="btn btn-lg btn-login btn-block" type="submit">
                <i class="fa fa-check"></i>登录
            </button>

            <div class="registration">
                还不是拼图用户?
                <a href="{:WebUrl('index/register',array())}">
                    立即注册
                </a>
            </div>
            <label class="checkbox">
                <span class="pull-right">
                    <a data-toggle="modal" href="#forget"> 忘记密码?</a>
                </span>
            </label>

        </div>

    </form>

</div>
<!-- Modal -->
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="forget" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">忘记密码?</h4>
            </div>
            <form id="forgetform">
                <div class="modal-body">
                    <p>请输入你注册的手机号</p>
                    <div class="form-group">
                    <div class="input-group">
                        <input type="tel" name="forgettel" placeholder="手机号" class="form-control">

                        <span class="input-group-btn">
                            <button class="btn btn-warning" type="button">获取验证码</button>
                        </span>
                    </div>
                    </div>

                    <div class="form-group">
                    <input type="tel" name="forgetcode" placeholder="验证码" class="form-control">
                        </div>
                    <div class="form-group">
                    <input type="password" class="form-control" name="forgetpassword" placeholder="新密码">
                    </div>
                    <div class="form-group">
                    <input type="password" class="form-control" name="forgetrepeatpass" placeholder="重复密码">
                        </div>
                </div>
                <div class="modal-footer">
                    <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
                    <button class="btn btn-primary" type="button" onclick="forgetsubmit();">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- modal -->
<!-- Placed js at the end of the document so the pages load faster -->
{js href="__PUBLIC__/admin/js/jquery-1.10.2.min.js,__PUBLIC__/admin/js/jquery-ui-1.9.2.custom.min.js,__PUBLIC__/admin/js/jquery-migrate-1.2.1.min.js,__PUBLIC__/admin/js/bootstrap.min.js,__PUBLIC__/admin/js/modernizr.min.js,__PUBLIC__/admin/js/jquery.nicescroll.js,__PUBLIC__/admin/js/scripts.js" /}
{js href="__PUBLIC__/js/common.js" /}
<script type="text/javascript">
    $(document).ready(function () {
        $('#loginform').submit(function () {
            var tel = $('input[name="tel"]').val();
            if(!isPhone(tel)){
                toastTop('手机格式不正确',2);
                return false;
            }
            var pass = $('input[name="password"]').val();
            if(pass==''){
                toastTop('密码不能为空',2);
                return false;
            }
            var code = $('input[name="verifycode"]').val();
            if(code==''){
                toastTop('验证码不能为空',2);
                return false;
            }
            return true;
        });

    });
    function forgetsubmit() {
        var tel = $('input[name="forgettel"]').val();
        if(!isPhone(tel)){
            toastTop('手机格式不正确',2);
            return false;
        }
        var pass = $('input[name="forgetpassword"]').val();
        if(pass==''){
            toastTop('密码不能为空',2);
            return false;
        }
        var repeatpass = $('input[name="forgetrepeatpass"]').val();
        if(pass!=repeatpass){
            toastTop('两次密码不一致',2);
            return false;
        }
        var code = $('input[name="forgetcode"]').val();
        if(code==''){
            toastTop('验证码不能为空',2);
            return false;
        }
        $.post('',{},function (data) {

        },'json');
    }
    function sendSms() {

        var tel = $('input[name="forgettel"]').val();
        if(!isPhone(tel)){
            toastTop('手机格式不正确',2);
            return false;
        }
        $.post('',{},function (data) {

        },'json');
    }

</script>>
</body>

</html>